package com.kingboy.cloud.exception;
/**
 * @author kingboy
 * @create 2020-08-03 16:49
 */

/**
 *@Description 运行期异常基类
 *@auther 郭金宝
 *@create 2020-08-03 16:49
 */
public abstract class BaseCheckedException extends Exception implements BaseException {


    /**
     * 异常信息
     */
    protected String message;

    /**
     * 具体异常码
     */
    protected int code;

    public BaseCheckedException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BaseCheckedException(int code, String format, Object... args) {
        super(String.format(format, args));
        this.code = code;
        this.message = String.format(format, args);
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }


}

